<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box1 {
        width: 100px;
        height: 100px;
        background-color: pink;
        opacity: 0;
      }
      .box2 {
        width: 100px;
        height: 100px;
        background-color: pink;
        visibility: hidden;
      }
      .box3 {
        width: 100px;
        height: 100px;
        background-color: pink;
      }
    </style>
  </head>
  <body>
    <!-- 
      1. display: none  不占位; 不响应事件;
      2. opacity: 0     占位; 响应事件;
      3. visibility: hidden 占位; 不响应事件;
      4. position: absolute; left: -100000; top: -1000000;
      5. 让别的定位元素覆盖掉自身
      6. transform: scale(0);
      7. transform: rotateY(90deg);
    -->
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <script>
      document.querySelector(".box1").onclick = function () {
        console.log("box1");
      };

      document.querySelector(".box2").onclick = function () {
        console.log("box2");
      };
    </script>
  </body>
</html>
